<!DOCTYPE html>
<html>
<include file="Public:header" />
<link href="__ACSS__/dialog.css" rel="stylesheet">
<link href="__ACSS__/plugins/validform/validform.css" rel="stylesheet">
<style>
	.form-control{ padding-left:5px;}
</style>
  <body>
	  <div class="wrapper wrapper-content animated fadeInRight">
		<form role="form" class="form" action="__URL__/update">
			<input type="hidden" name="id" value="<{$vo.id}>">
			<input type="hidden" name="update_time" value="<php>echo time();</php>">
			<div class="form-group">
				<label class="col-sm-2 control-label">学校名称：</label>
				<div class="col-sm-10">
					<input type="text" datatype="*" name="name" class="form-control" value="<{$vo.name}>" placeholder="学校名称" ajaxurl="__URL__/exCheckName?id=<{$vo.id}>">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">省市区：</label>
				<div class="col-sm-10">
					<div class="col-sm-4" style="padding-left:0;">
						<select id="province" datatype="*" name="province" class="form-control">
							<foreach item="province" name="province">
								<option value="<{$province.province}>" ref="<{$province.id}>" <if condition="$province['id'] eq $vo['province_code']"> selected</if>><{$province.province}></option>
							</foreach>
						</select>
					</div>
					<div class="col-sm-4" style="padding-left:0;">
						<select id="city" datatype="*" name="city" class="form-control">
							<foreach item="city" name="city">
								<option value="<{$city.city}>" ref="<{$city.id}>" <if condition="$city['id'] eq $vo['city_code']"> selected</if>><{$city.city}></option>
							</foreach>
						</select>
					</div>
					<div class="col-sm-4" style="padding-left:0; padding-right:0;">
						<select id="area" datatype="*" name="area" class="form-control">
							<foreach item="area" name="area">
								<option value="<{$area.area}>" ref="<{$area.id}>" <if condition="$area['id'] eq $vo['area_code']"> selected</if>><{$area.area}></option>
							</foreach>
						</select>
					</div>
				</div>
			</div>
			<div class="clearfix">
				<button type="submit" id="submit" class="btn btn-success btn-block">提交</button>
				<button type="reset" id="reset2" class="hidden btn btn-success btn-block">重置</button>
			</div>
		</form>
	  </div>
  </body>
<!-- 全局js -->
<include file="Public:foot" />
<script src="__AJSPLUGINS__/validform/Validform_v5.3.2_min.js"></script>
<script src="__AJS__/jquery.md5.js"></script>
<script>
$(function(){
	$("#reset2").click();
	var index = parent.layer.getFrameIndex(window.name);
	var form = $(".form").Validform({
		tiptype:4,
		ajaxPost:true,
		beforeSubmit:function(curform){
			var groups = "";
			$(".group:checked").each(function(index){
				if(index ==0) {
					groups += $(this).val();
				}else{
					groups += "," + $(this).val();
				}
			})
			$("#groups").val(groups);
		},
		callback:function(data){
			if(data.status == 1) {
				window.parent.layer.msg(data.info);
				window.parent.$('#table_list').trigger("reloadGrid");
			}else{
				window.parent.layer.msg(data.info);
			}
			parent.layer.close(index);
		}
	});
})
</script>
</html>